<template>
  <div class="biaoge">
        <div class="operate_inputs">
            <el-form :inline="true" :model="formInline" class="demo-form-inline">
                <el-form-item label="手机号:">
                    <el-input class="divided_200 inputReset" v-model="formInline.username_kw"></el-input>
                </el-form-item>
                 <el-form-item label="昵称:">
                    <el-input class="divided_200 inputReset" v-model="formInline.nickname_kw"></el-input>
                </el-form-item>
                <el-form-item label="学员状态:">
                    <el-select class="divided_200 inputReset" filterable v-model="formInline.status" placeholder="全部">
                        <el-option v-for="(p,j) in status" :key='j' :label="p.attriname" :value="p.attriid"></el-option>
                    </el-select>
                <!-- </el-form-item> -->
                 <!-- v-if='xxSelect'  -->
                <!-- <el-form-item> -->
                    <!-- <el-select class="divided_200" v-model="formInline.agentid" placeholder="线下校列表">
                        <el-option  v-for="(a,i) in agents" :key='i' :label="a.nickname" :value="a.userid"></el-option>
                    </el-select> -->
                <!-- </el-form-item>
                <el-form-item> -->
                    <el-select class="divided_200 inputReset" filterable v-model="formInline.ccId" placeholder="所属CC">
                        <el-option  v-for="(c,k) in ccList" :key='k' :label="c.realname" :value="c.userid"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="代转化学员">
                    <el-select class="divided_4" v-model="formInline.waitStatus">
                        <el-option value='-1' label="全部"></el-option>
                        <el-option value="1" label='是'></el-option>
                        <el-option value="0" label="否"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="时间段:">
                    <el-date-picker
                        v-model="formInline.startTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="选择开始日期" style="width:200px;">
                    </el-date-picker>
                    <el-date-picker
                        v-model="formInline.endTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="选择结束日期" style="width:200px;">
                    </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button class="search_btn" style='width:100px;' type="primary" @click="getData(true)"><i class="el-icon-search"></i>查询</el-button>
                    <el-button class="reset_btn" style='width:100px;' type="primary" @click="clearSearch"><i class="el-icon-refresh"></i>清空查询</el-button>
                </el-form-item>
            </el-form>
        </div>
        <!-- v-loading="true" -->
        <el-table
            v-loading="loading2"
            element-loading-text="加载中..."
            :data="studentsData"
            stripe 
            size="mini"
            border resizable
            style="width: 100%"
            :height="tableHeight">
            <el-table-column label="注册时间" :align="align">
                <template slot-scope="scope">{{scope.row.regdate | transData}} </template>
                <!-- <template slot-scope="scope">{{Number(scope.row.regdate) | dateForm}} </template> -->
            </el-table-column>
            <el-table-column label="学员账号" :align="align">
                <template slot-scope="scope">{{scope.row.username}}</template>
            </el-table-column>
            <el-table-column label="学员昵称" :align="align">
                <template slot-scope="scope">{{scope.row.nickname}}</template>
            </el-table-column>
            <el-table-column label="所属代理商" :align="align">
                <template slot-scope="scope">{{scope.row.agentCompany}}</template>
            </el-table-column>
            <el-table-column label="所属CC" :align="align">
                <template slot-scope="scope" >{{scope.row.adminCCName}}</template>
            </el-table-column>
            <el-table-column label="CC联系方式(QQ)" :align="align">
                <template slot-scope="scope">{{scope.row.adminCCQQ}}</template>
            </el-table-column>
            <el-table-column label="学员状态" :align="align">
                <template slot-scope="scope">{{scope.row.statusName}}</template>
            </el-table-column>
            <el-table-column label="已/未代转化" :align="align">
                <template slot-scope="scope">{{scope.row.waitStatusName}}</template>
            </el-table-column>

            <el-table-column 
                fixed="right" 
                :align="align"
                min-width="200"
                :data="studentsData"
                label="操作">
                <template slot-scope="scope">
                    <el-button
                        size="mini"
                        @click="getFile(scope.row.userid,scope.row.ischild)">档案</el-button>
                    <!-- <el-button
                        size="mini"
                         @click='addRecord(scope.row.userid)'>添加回访记录</el-button>
                    <el-button
                        size="mini"
                        type="info" plain
                        @click="handleEdit(scope.row.userid,scope.row.ischild)">编辑资料</el-button> -->
                    <el-button
                        size="mini"
                        @click="applyTransfer(scope.row.userid)"
                        v-if='scope.row.waitStatus==0?true:false'>申请代转化学员</el-button>
                    <el-button
                        size="mini"  
                        v-if='scope.row.waitStatus==1?true:false'>已转化学员</el-button>
                </template>
            </el-table-column>
        </el-table>
        <!-- 编辑资料弹窗 -->
        <div>
            <el-dialog title="编辑少儿学员资料" :modal=false :close-on-click-modal=false v-if="ifchild" :visible.sync="dialogFormVisible">
                <el-form :model="form">
                    <el-form-item label-width="80px">
                        <div class="member_info">学员信息</div>
                    </el-form-item>
                    <el-form-item label="登录账号：" :label-width="formLabelWidth">
                        <el-input v-model="form.username" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="登录密码：" placeholder="不填则不修改" :label-width="formLabelWidth">
                        <el-input type="password" v-model="form.new_pwd"></el-input>
                    </el-form-item>
                    <el-form-item label="注册时间：" :label-width="formLabelWidth">
                        <el-input v-model="form.regdate" disabled></el-input>
                    </el-form-item>
                        <el-form-item label="上次登陆时间：" :label-width="formLabelWidth">
                        <el-input v-model="form.lastdate" disabled></el-input>
                    </el-form-item>
                        <el-form-item label="登录次数：" :label-width="formLabelWidth">
                        <el-input v-model="form.loginnum" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="昵称：" :label-width="formLabelWidth">
                        <el-input v-model="form.nickname"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号：" :label-width="formLabelWidth">
                        <el-input v-model="form.mobile"></el-input>
                    </el-form-item>
                    <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                        <el-input v-model="form.fullname"></el-input>
                    </el-form-item>
                    <el-form-item label="发送信息给学员：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.sendmail">
                            <el-radio label=1>是</el-radio>
                            <el-radio label=0>否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="QQ：" :label-width="formLabelWidth">
                        <el-input v-model="form.qq"></el-input>
                    </el-form-item>
                    <el-form-item label="SKype：" :label-width="formLabelWidth">
                        <el-input v-model="form.skypenum" ></el-input>
                    </el-form-item>
                    <el-form-item label="Email：" :label-width="formLabelWidth">
                        <el-input v-model="form.email"></el-input>
                    </el-form-item>
                    <el-form-item label="性别：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.gender">
                            <el-radio label=1>男</el-radio>
                            <el-radio label=0>女</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="出生日期：" :label-width="formLabelWidth">
                        <div class="block">
                            <el-date-picker
                            v-model="form.birthday"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择日期">
                            </el-date-picker>
                        </div>
                    </el-form-item>
                    <el-form-item label="喜欢的动画片或玩具：" :label-width="formLabelWidth">
                        <el-input v-model="form.toycartoon"></el-input>
                    </el-form-item>
                    <el-form-item label="所在年级：" :label-width="formLabelWidth">
                        <el-select v-model="form.shoolPeriod" @change='getPeriod' placeholder="选择学年" class="divided_3">
                            <el-option 
                            v-for="(sp,a) in childData.shoolperiod"
                            :key="a" :label="sp.attriname" 
                            :value="sp.attriid"></el-option>
                        </el-select>
                        <el-select v-model="form.grade" placeholder="选择年级" class="divided_3">
                            <el-option v-for="(gradeitem,gd) in grade_lists" :key='gd' :label="gradeitem" :value="gd"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="性格特点：" :label-width="formLabelWidth">
                        <el-select v-model="form.character" placeholder="选择性格">
                            <el-option 
                            v-for="(childcc,b) in childData.childcharacters"
                            :key="b" :label="childcc.attriname" :value="childcc.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="学员头像" :label-width="formLabelWidth">
                        <el-upload
                            :action='avatar_url'
                            :data='upLoadData'
                            name='files'
                            :limit=1  
                            v-model="form.avatar"
                            :on-success='uploadAvatar'
                            list-type="picture-card">
                            <i class="el-icon-plus"></i>
                        </el-upload>
                    </el-form-item>
                    <el-form-item label="礼品邮寄地址：" :label-width="formLabelWidth">
                        <el-cascader
                            size="large"
                            :options="options"
                            v-model="form.address"
                            @change="handleChange">
                        </el-cascader>
                        <el-input v-model="form.giftAddr" class="divided_200"></el-input>
                    </el-form-item>
                    <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                        <el-checkbox-group v-model="form.studyfrom">
                            <el-checkbox 
                            v-for="(studyf,d) in childData.studyfrom"
                            :key="d" :label="studyf.attriid">{{studyf.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label-width="80px">
                        <div class="member_info">家庭信息</div>
                    </el-form-item>
                    <el-form-item label-width="80px">
                        <el-tag type="info">父亲信息</el-tag>
                    </el-form-item>
                    <el-form-item label="姓名：" :label-width="formLabelWidth">
                        <el-input v-model="form.dadname"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号：" :label-width="formLabelWidth">
                        <el-input v-model="form.dadmobile"></el-input>
                    </el-form-item>
                    <el-form-item label="年龄：" :label-width="formLabelWidth">
                        <el-input v-model="form.dadage"></el-input>
                    </el-form-item>
                    <el-form-item label="职业性质：" :label-width="formLabelWidth">
                        <el-select v-model="form.dadjobs" placeholder="选择父亲职业">
                            <el-option 
                            v-for="(dadjob,e) in childData.jobs"
                            :key="e" :label="dadjob.attriname" :value="dadjob.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label-width="80px">
                        <el-tag type="info">母亲信息</el-tag>
                    </el-form-item>
                    <el-form-item label="姓名：" :label-width="formLabelWidth">
                        <el-input v-model="form.mumname"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号：" :label-width="formLabelWidth">
                        <el-input v-model="form.mummobile"></el-input>
                    </el-form-item>
                    <el-form-item label="年龄：" :label-width="formLabelWidth">
                        <el-input v-model="form.mumage"></el-input>
                    </el-form-item>
                    <el-form-item label="职业性质：" :label-width="formLabelWidth">
                        <el-select v-model="form.mumjob" placeholder="选择母亲职业">
                            <el-option 
                            v-for="(mumjob,f) in childData.jobs"
                            :key="f" :label="mumjob.attriname" :value="mumjob.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="家庭收入：" :label-width="formLabelWidth">
                        <el-select v-model="form.familyincome" placeholder="请选择">
                            <el-option 
                            v-for="(fain,g) in childData.familyincomes"
                            :key="g" :label="fain.attriname" :value="fain.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否已经开始学习英语：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.alreadystudy">
                            <el-radio label=1>是</el-radio>
                            <el-radio label=0>否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if='form.alreadystudy==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                        <el-input v-model="form.studytime"></el-input>
                    </el-form-item>
                    <el-form-item v-if='form.alreadystudy==1?true:false' label="学习英语以哪种方式开始：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.stratway">
                            <el-radio 
                            v-for="(starw,h) in childData.startways"
                            :key="h" :label="starw.attriid">{{starw.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if='form.alreadystudy==1?true:false' label="是否接触过外教课程：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.withforeign">
                            <el-radio label=1>是</el-radio>
                            <el-radio label=0>否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                     <el-form-item v-if='form.withforeign==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                        <el-input v-model="form.foreigntime"></el-input>
                    </el-form-item>
                    <el-form-item label="就读学校：" :label-width="formLabelWidth">
                        <el-input v-model="form.schoolname"></el-input>
                    </el-form-item>
                     <el-form-item v-if='form.alreadystudy==1?true:false' label="孩子在校的英语成绩排名：" :label-width="formLabelWidth">
                        <el-select v-model="form.englishrank" placeholder="选择排名">
                            <el-option 
                            v-for="(enrank,i) in childData.englishrank"
                            :key="i" :label="enrank.attriname" :value="enrank.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="孩子目前英语水平：" :label-width="formLabelWidth">
                        <el-select v-model="form.englishlevel" placeholder="请选择">
                            <el-option 
                            v-for="(enlevel,j) in childData.englislevel"
                            :key="j" :label="enlevel.attriname" :value="enlevel.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="对孩子学习英语的期望：" :label-width="formLabelWidth">
                        <el-checkbox-group v-model="form.expects">
                            <el-checkbox v-for="(expec,k) in childData.expects" :key="k" :label="expec.attriid" name="expects">{{expec.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                     <el-form-item label="更希望孩子提升哪些方面：" :label-width="formLabelWidth">
                        <el-checkbox-group v-model="form.improvefields">
                            <el-checkbox v-for="(impf,l) in childData.improvefields" :key="l" :label="impf.attriid" name="improvefields">{{impf.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="选择机构时首选考虑因素：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.considerfield">
                            <el-radio v-for="(consfi,m) in childData.considerfields" :key="m" :label="consfi.attriid">{{consfi.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="每周预计投入学习时间：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.weekTime">
                            <el-radio v-for="(weekt,n) in childData.weektime" :key="n" :label="weekt.attriid">{{weekt.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="适合孩子的上课时间：" :label-width="formLabelWidth">
                        <el-checkbox-group v-model="form.suitabletime">
                            <el-checkbox v-for="(suitt,o) in childData.suitabletime" :key="o" :label="suitt.attriid" name="suitabletime">{{suitt.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="每月孩子学习英语的预算：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.monthbudget">
                            <el-radio ref="ref" v-for="(monthb,p) in childData.monthbudget" :key="p" :label="monthb.attriid">{{monthb.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                        <el-select v-model="form.finishtime" placeholder="选择时间">
                            <el-option v-for="(studyshi,q) in childData.studyshijian" :key="q" :label="studyshi.attriname" :value="studyshi.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="预算：" :label-width="formLabelWidth">
                        <el-select v-model="form.budget" placeholder="选择预算">
                            <el-option v-for="(studymon,r) in childData.studymoney" :key="r" :label="studymon.attriname" :value="studymon.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                        <el-input v-model="form.appeal"></el-input>
                    </el-form-item>
                    <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                        <el-input v-model="form.firstpay" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                        <el-input v-model="form.teachernote"></el-input>
                    </el-form-item>
                    <el-form-item label="学员状态：" :label-width="formLabelWidth">
                        <el-select v-model="form.status" placeholder="选择状态">
                            <el-option v-for="(membersta,s) in childData.memberStatusList" :key="s" 
                            :label="membersta.attriname" :value="membersta.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                
                <div slot="footer" class="dialog-footer">
                    <el-button class="dialog_close" @click="dialogFormVisible = false">取 消</el-button>
                    <el-button class="dialog_confirm" type="primary" @click="editChild">确 定</el-button>
                </div>
            </el-dialog>
           
            <el-dialog title="编辑成人学员信息" :close-on-click-modal=false v-if="!ifchild" :visible.sync="dialogFormVisible">
                <el-form :model="form" >
                    <el-form-item label="昵称：" :label-width="formLabelWidth">
                        <el-input v-model="form.nickname" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="密码：" :label-width="formLabelWidth">
                        <el-input v-model="form.new_pwd" type="password" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                        <el-input v-model="form.fullname" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="手机：" :label-width="formLabelWidth">
                        <el-input v-model="form.mobile" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="Email：" :label-width="formLabelWidth">
                        <el-input v-model="form.email" auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="性别：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.gender">
                            <el-radio label=1>男</el-radio>
                            <el-radio label=0>女</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="学员头像" :label-width="formLabelWidth">
                        <el-upload
                            :action='avatar_url'
                            :data='upLoadData'
                            name='files'
                            :limit=1  
                            :on-success='uploadAvatar'
                            v-model="form.face"
                            list-type="picture-card">
                            <i class="el-icon-plus"></i>
                        </el-upload>
                    </el-form-item>
                    <el-form-item label="礼品邮寄地址：" :label-width="formLabelWidth">
                        <el-cascader
                            size="large"
                            :options="options"
                            v-model="form.address"
                            @change="handleChange">
                        </el-cascader>
                    </el-form-item>
                    <el-form-item label="大学：" :label-width="formLabelWidth">
                        <el-input v-model="form.daxue" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="专业：" :label-width="formLabelWidth">
                        <el-input v-model="form.zhuanye" auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="公司：" :label-width="formLabelWidth">
                        <el-input v-model="form.gongsi" auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="行业：" placeholder="选择一项行业" :label-width="formLabelWidth">
                        <el-select v-model="form.job">
                            <el-option v-for="(jobitem,c) in fromLabel.job" :key="c" :label="jobitem.attriname" :value="jobitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="职位：" :label-width="formLabelWidth">
                        <el-input v-model="form.zhiwei" auto-complete="off"></el-input>
                    </el-form-item>
                    
                    <el-form-item label="公司网站：" :label-width="formLabelWidth">
                        <el-input v-model="form.gongsiwangzhi" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="公司电话：" :label-width="formLabelWidth">
                        <el-input v-model="form.gongsidianhua" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="公司人事联系人：" :label-width="formLabelWidth">
                        <el-input v-model="form.lianxiren" class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="qq" :label-width="formLabelWidth">
                        <el-input v-model="form.qq" auto-complete="off"></el-input>
                    </el-form-item>  
                    <el-form-item label="SKype：" :label-width="formLabelWidth">
                        <el-input v-model="form.skypenum" auto-complete="off"></el-input>
                    </el-form-item>  
                    <el-form-item label="分类：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.isfirststudy">
                            <el-radio label=0>第一次学习</el-radio>
                            <el-radio label=1>上过体验课</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="年龄段：" placeholder="选取年龄段" :label-width="formLabelWidth">
                        <el-select v-model="form.age">
                            <el-option v-for="(ageitem,a) in fromLabel.age" :key="a" :label="ageitem.attriname" :value="ageitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                        <el-checkbox-group v-model="form.studyfrom">
                            <el-checkbox v-for="(studyfitem,g) in fromLabel.studyfrom" :key="g" :label="studyfitem.attriid" name="studyfrom">{{studyfitem.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="英语水平：" placeholder="选取英语水平" :label-width="formLabelWidth">
                        <el-select v-model="form.studylevel">
                            <el-option v-for="(slitem,b) in fromLabel.studylevel" :key="b" :label="slitem.attriname" :value="slitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="英语分数：" :label-width="formLabelWidth">
                        <el-input v-model="form.highscore" class="divided_2"></el-input>
                    </el-form-item>                     
                    <el-form-item :label-width="formLabelWidth" label="学习英语第一目标-课程：">
                        <el-checkbox-group v-model="form.wanttostudy">
                            <el-checkbox v-for="(ccitem,d) in fromLabel.curriculumType" :key="d" :label="ccitem.id" name="curriculumType">{{ccitem.title}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item :label-width="formLabelWidth" label="学习英语第二目标-方面：">
                        <el-checkbox-group v-model="form.studyhigh">
                            <el-checkbox v-for="(studyhitem,e) in fromLabel.studyhigh" :key="e" :label="studyhitem.attriid" name="studyhigh">{{studyhitem.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item :label-width="formLabelWidth" label="学习英语第三目标-知识：">
                        <el-checkbox-group v-model="form.studyextension">
                            <el-checkbox v-for="(studyexitem,f) in fromLabel.studyextension" :key="f" :label="studyexitem.attriid" name="studyextension">{{studyexitem.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                        <el-select v-model="form.studyshijian">
                            <el-option v-for="(stshiitem,h) in fromLabel.studyshijian" :key="h" :label="stshiitem.attriname" :value="stshiitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="预算：" :label-width="formLabelWidth">
                        <el-select v-model="form.studymoney">
                            <el-option v-for="(stmitem,i) in fromLabel.studymoney" :key="i" :label="stmitem.attriname" :value="stmitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学员评测等级：" :label-width="formLabelWidth">
                        <el-select v-model="form.level">
                            <el-option v-for="(studylevel,j) in fromLabel.StudentEvaluationGrade" :key="j" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学员目标等级：" :label-width="formLabelWidth">
                        <el-select v-model="form.targetlevel">
                            <el-option v-for="(studylevel,k) in fromLabel.StudentEvaluationGrade" :key="k" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                        <el-input v-model="form.iwant" class="divided_2"></el-input>
                    </el-form-item> 
                    <el-form-item label="学员分组：" :label-width="formLabelWidth">
                        <el-select v-model="form.groupid">
                            <el-option v-for="(mgitem,l) in fromLabel.member_group" :key="l" :label="mgitem.name" :value="mgitem.groupid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                        <el-input v-model="form.firstpay" class="divided_2"></el-input>
                    </el-form-item> 
                     <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                        <el-input v-model="form.tutorcomment" class="divided_2"></el-input>
                    </el-form-item> 
                    <el-form-item label="学员状态：" :label-width="formLabelWidth">
                        <el-select v-model="form.status" placeholder="选择状态">
                            <el-option v-for="(membersta,s) in fromLabel.memberStatusList" :key="s" :label="membersta.attriname" :value="membersta.attriid"></el-option>
                        </el-select>
                    </el-form-item>   
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button class="dialog_close" @click="dialogFormVisible = false">取 消</el-button>
                    <el-button class="dialog_confirm" type="primary" @click="editAdult">确 定</el-button>
                </div>
            </el-dialog>
        </div>
        <!-- 档案 -->
        <div>
             <el-dialog title="查看少儿学员资料" :modal=false :close-on-click-modal=false v-if="ifchild" :visible.sync="dialogFormVisible2">
                <el-form :model="form">
                    <el-form-item label-width="80px">
                        <div class="member_info">学员信息</div>
                    </el-form-item>
                    <el-form-item label="昵称：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.nickname"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.mobile"></el-input>
                    </el-form-item>
                    <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.fullname"></el-input>
                    </el-form-item>
                    <el-form-item label="发送信息给学员：" :label-width="formLabelWidth">
                        <el-radio-group disabled v-model="form.sendmail">
                            <el-radio label=1>是</el-radio>
                            <el-radio label=0>否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="QQ：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.qq"></el-input>
                    </el-form-item>
                    <el-form-item label="SKype：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.skypenum" ></el-input>
                    </el-form-item>
                    <el-form-item label="Email：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.email"></el-input>
                    </el-form-item>
                    <el-form-item label="性别：" :label-width="formLabelWidth">
                        <el-radio-group  disabled v-model="form.gender">
                            <el-radio label=1>男</el-radio>
                            <el-radio label=0>女</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="出生日期：" :label-width="formLabelWidth">
                        <div class="block">
                            <el-date-picker
                            v-model="form.birthday"
                            type="date"
                            disabled
                            value-format="yyyy-MM-dd"
                            placeholder="选择日期">
                            </el-date-picker>
                        </div>
                    </el-form-item>
                    <el-form-item label="喜欢的动画片或玩具：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.toycartoon"></el-input>
                    </el-form-item>
                    <el-form-item label="所在年级：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.shoolPeriod" @change='getPeriod' placeholder="选择学年" class="divided_3">
                            <el-option 
                            v-for="(sp,a) in childData.shoolperiod"
                            :key="a" :label="sp.attriname" 
                            :value="sp.attriid"></el-option>
                        </el-select>
                        <el-select disabled v-model="form.grade" placeholder="选择年级" class="divided_3">
                            <el-option v-for="(gradeitem,gd) in grade_lists" :key='gd' :label="gradeitem" :value="gd"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="性格特点：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.character" placeholder="选择性格">
                            <el-option 
                            v-for="(childcc,b) in childData.childcharacters"
                            :key="b" :label="childcc.attriname" :value="childcc.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="礼品邮寄地址：" :label-width="formLabelWidth">
                        <el-cascader
                            size="large"
                             disabled
                            :options="options"
                            v-model="form.address"
                            @change="handleChange">
                        </el-cascader>
                        <el-input v-model="form.giftAddr" class="divided_200"></el-input>
                    </el-form-item>
                    <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                        <el-checkbox-group disabled v-model="form.studyfrom">
                            <el-checkbox 
                            v-for="(studyf,d) in childData.studyfrom"
                            :key="d" :label="studyf.attriid">{{studyf.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label-width="80px">
                        <div class="member_info">家庭信息</div>
                    </el-form-item>
                    <el-form-item label-width="80px">
                        <el-tag type="info">父亲信息</el-tag>
                    </el-form-item>
                    <el-form-item label="姓名：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.dadname"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.dadmobile"></el-input>
                    </el-form-item>
                    <el-form-item label="年龄：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.dadage"></el-input>
                    </el-form-item>
                    <el-form-item label="职业性质：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.dadjobs" placeholder="选择父亲职业">
                            <el-option 
                            v-for="(dadjob,e) in childData.jobs"
                            :key="e" :label="dadjob.attriname" :value="dadjob.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label-width="80px">
                        <el-tag type="info">母亲信息</el-tag>
                    </el-form-item>
                    <el-form-item label="姓名：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.mumname"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.mummobile"></el-input>
                    </el-form-item>
                    <el-form-item label="年龄：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.mumage"></el-input>
                    </el-form-item>
                    <el-form-item label="职业性质：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.mumjob" placeholder="选择母亲职业">
                            <el-option 
                            v-for="(mumjob,f) in childData.jobs"
                            :key="f" :label="mumjob.attriname" :value="mumjob.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="家庭收入：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.familyincome" placeholder="请选择">
                            <el-option 
                            v-for="(fain,g) in childData.familyincomes"
                            :key="g" :label="fain.attriname" :value="fain.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否已经开始学习英语：" :label-width="formLabelWidth">
                        <el-radio-group disabled  v-model="form.alreadystudy">
                            <el-radio label=1>是</el-radio>
                            <el-radio label=0>否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if='form.alreadystudy==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.studytime"></el-input>
                    </el-form-item>
                    <el-form-item v-if='form.alreadystudy==1?true:false' label="学习英语以哪种方式开始：" :label-width="formLabelWidth">
                        <el-radio-group disabled  v-model="form.stratway">
                            <el-radio 
                            v-for="(starw,h) in childData.startways"
                            :key="h" :label="starw.attriid">{{starw.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if='form.alreadystudy==1?true:false' label="是否接触过外教课程：" :label-width="formLabelWidth">
                        <el-radio-group disabled  v-model="form.withforeign">
                            <el-radio label=1>是</el-radio>
                            <el-radio label=0>否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                     <el-form-item v-if='form.withforeign==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.foreigntime"></el-input>
                    </el-form-item>
                    <el-form-item label="就读学校：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.schoolname"></el-input>
                    </el-form-item>
                     <el-form-item v-if='form.alreadystudy==1?true:false' label="孩子在校的英语成绩排名：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.englishrank" placeholder="选择排名">
                            <el-option 
                            v-for="(enrank,i) in childData.englishrank"
                            :key="i" :label="enrank.attriname" :value="enrank.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="孩子目前英语水平：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.englishlevel" placeholder="请选择">
                            <el-option 
                            v-for="(enlevel,j) in childData.englislevel"
                            :key="j" :label="enlevel.attriname" :value="enlevel.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="对孩子学习英语的期望：" :label-width="formLabelWidth">
                        <el-checkbox-group disabled v-model="form.expects">
                            <el-checkbox v-for="(expec,k) in childData.expects" :key="k" :label="expec.attriid" name="expects">{{expec.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                     <el-form-item label="更希望孩子提升哪些方面：" :label-width="formLabelWidth">
                        <el-checkbox-group disabled v-model="form.improvefields">
                            <el-checkbox v-for="(impf,l) in childData.improvefields" :key="l" :label="impf.attriid" name="improvefields">{{impf.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="选择机构时首选考虑因素：" :label-width="formLabelWidth">
                        <el-radio-group disabled  v-model="form.considerfield">
                            <el-radio v-for="(consfi,m) in childData.considerfields" :key="m" :label="consfi.attriid">{{consfi.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="每周预计投入学习时间：" :label-width="formLabelWidth">
                        <el-radio-group disabled  v-model="form.weekTime">
                            <el-radio v-for="(weekt,n) in childData.weektime" :key="n" :label="weekt.attriid">{{weekt.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="适合孩子的上课时间：" :label-width="formLabelWidth">
                        <el-checkbox-group disabled v-model="form.suitabletime">
                            <el-checkbox v-for="(suitt,o) in childData.suitabletime" :key="o" :label="suitt.attriid" name="suitabletime">{{suitt.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="每月孩子学习英语的预算：" :label-width="formLabelWidth">
                        <el-radio-group disabled  v-model="form.monthbudget">
                            <el-radio ref="ref" v-for="(monthb,p) in childData.monthbudget" :key="p" :label="monthb.attriid">{{monthb.attriname}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.finishtime" placeholder="选择时间">
                            <el-option v-for="(studyshi,q) in childData.studyshijian" :key="q" :label="studyshi.attriname" :value="studyshi.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="预算：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.budget" placeholder="选择预算">
                            <el-option v-for="(studymon,r) in childData.studymoney" :key="r" :label="studymon.attriname" :value="studymon.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.appeal"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.firstpay" disabled></el-input>
                    </el-form-item> -->
                    <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.teachernote"></el-input>
                    </el-form-item>
                    <el-form-item label="学员状态：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.status" placeholder="选择状态">
                            <el-option v-for="(membersta,s) in childData.memberStatusList" :key="s" :label="membersta.attriname" :value="membersta.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                <!-- 回访记录 -->
                <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                <el-table
                    :data="gotRecord"
                    stripe 
                    size="mini"
                    border resizable
                    style="width: 100%;margin-left:40px;"
                    max-height="656">
                    <el-table-column label="回访结果" :align="align" :width="columWidth2">
                        <template slot-scope="scope">{{scope.row.lev1}} {{scope.row.lev2}} {{scope.row.lev3}}</template>
                    </el-table-column>
                    <el-table-column label="回访内容" :align="align" :width="columWidth2">
                        <template slot-scope="scope">{{scope.row.content}}</template>
                    </el-table-column>
                    <el-table-column label="回访人" :align="align" :width="columWidth">
                        <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                    </el-table-column>
                    <el-table-column label="回访时间" :align="align" :width="columWidth">
                        <template slot-scope="scope">{{scope.row._time}}</template>
                    </el-table-column>
                </el-table> 
                <div slot="footer" class="dialog-footer">
                    <el-button class="dialog_close" @click="dialogFormVisible2 = false">关闭</el-button>
                </div>
            </el-dialog>
           
            <el-dialog title="查看成人学员信息" :modal=false :close-on-click-modal=false v-if="!ifchild" :visible.sync="dialogFormVisible2">
                <el-form :model="form" >
                     <el-form-item label="登录账号：" :label-width="formLabelWidth">
                        <el-input v-model="form.username" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="注册时间：" :label-width="formLabelWidth">
                        <el-input v-model="form.regdate" disabled></el-input>
                    </el-form-item>
                        <el-form-item label="上次登陆时间：" :label-width="formLabelWidth">
                        <el-input v-model="form.lastdate" disabled></el-input>
                    </el-form-item>
                        <el-form-item label="登录次数：" :label-width="formLabelWidth">
                        <el-input v-model="form.loginnum" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="昵称：" :label-width="formLabelWidth">
                        <el-input v-model="form.nickname" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                        <el-input v-model="form.fullname" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="手机：" :label-width="formLabelWidth">
                        <el-input v-model="form.mobile" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="Email：" :label-width="formLabelWidth">
                        <el-input v-model="form.email" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="性别：" :label-width="formLabelWidth">
                        <el-radio-group  v-model="form.gender" disabled>
                            <el-radio label=1>男</el-radio>
                            <el-radio label=0>女</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="大学：" :label-width="formLabelWidth">
                        <el-input v-model="form.daxue" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="专业：" :label-width="formLabelWidth">
                        <el-input v-model="form.zhuanye" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="公司：" :label-width="formLabelWidth">
                        <el-input v-model="form.gongsi" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="行业：" placeholder="选择一项行业" :label-width="formLabelWidth">
                        <el-select v-model="form.job" disabled>
                            <el-option v-for="(jobitem,c) in fromLabel.job" :key="c" :label="jobitem.attriname" :value="jobitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="职位：" :label-width="formLabelWidth">
                        <el-input v-model="form.zhiwei" disabled></el-input>
                    </el-form-item>
                    
                    <el-form-item label="公司网站：" :label-width="formLabelWidth">
                        <el-input v-model="form.gongsiwangzhi" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="公司电话：" :label-width="formLabelWidth">
                        <el-input v-model="form.gongsidianhua" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="公司人事联系人：" :label-width="formLabelWidth">
                        <el-input v-model="form.lianxiren" disabled class="divided_2"></el-input>
                    </el-form-item>
                    <el-form-item label="qq" :label-width="formLabelWidth">
                        <el-input v-model="form.qq" disabled></el-input>
                    </el-form-item>  
                    <el-form-item label="SKype：" :label-width="formLabelWidth">
                        <el-input v-model="form.skypenum" disabled></el-input>
                    </el-form-item>  
                    <el-form-item label="分类：" :label-width="formLabelWidth">
                        <el-radio-group  disabled v-model="form.isfirststudy">
                            <el-radio label=0>第一次学习</el-radio>
                            <el-radio label=1>上过体验课</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="年龄段：" placeholder="选取年龄段" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.age">
                            <el-option v-for="(ageitem,a) in fromLabel.age" :key="a" :label="ageitem.attriname" :value="ageitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                        <el-checkbox-group disabled v-model="form.studyfrom">
                            <el-checkbox v-for="(studyfitem,g) in fromLabel.studyfrom" :key="g" :label="studyfitem.attriid" name="studyfrom">{{studyfitem.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="英语水平：" placeholder="选取英语水平" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.studylevel">
                            <el-option v-for="(slitem,b) in fromLabel.studylevel" :key="b" :label="slitem.attriname" :value="slitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="英语分数：" :label-width="formLabelWidth">
                        <el-input v-model="form.highscore" disabled class="divided_2"></el-input>
                    </el-form-item>                     
                    <el-form-item :label-width="formLabelWidth" label="学习英语第一目标-课程：">
                        <el-checkbox-group disabled v-model="form.wanttostudy">
                            <el-checkbox v-for="(ccitem,d) in fromLabel.curriculumType" :key="d" :label="ccitem.id" name="curriculumType">{{ccitem.title}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item :label-width="formLabelWidth" label="学习英语第二目标-方面：">
                        <el-checkbox-group disabled v-model="form.studyhigh">
                            <el-checkbox v-for="(studyhitem,e) in fromLabel.studyhigh" :key="e" :label="studyhitem.attriid" name="studyhigh">{{studyhitem.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item :label-width="formLabelWidth" label="学习英语第三目标-知识：">
                        <el-checkbox-group disabled v-model="form.studyextension">
                            <el-checkbox v-for="(studyexitem,f) in fromLabel.studyextension" :key="f" :label="studyexitem.attriid" name="studyextension">{{studyexitem.attriname}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.studyshijian">
                            <el-option v-for="(stshiitem,h) in fromLabel.studyshijian" :key="h" :label="stshiitem.attriname" :value="stshiitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="预算：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.studymoney">
                            <el-option v-for="(stmitem,i) in fromLabel.studymoney" :key="i" :label="stmitem.attriname" :value="stmitem.attriid"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学员评测等级：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.level">
                            <el-option v-for="(studylevel,j) in fromLabel.StudentEvaluationGrade" :key="j" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学员目标等级：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.targetlevel">
                            <el-option v-for="(studylevel,k) in fromLabel.StudentEvaluationGrade" :key="k" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                        <el-input v-model="form.iwant" disabled class="divided_2"></el-input>
                    </el-form-item> 
                    <el-form-item label="学员分组：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.groupid">
                            <el-option v-for="(mgitem,l) in fromLabel.member_group" :key="l" :label="mgitem.name" :value="mgitem.groupid"></el-option>
                        </el-select>
                    </el-form-item>
                    <!-- <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.firstpay" class="divided_2"></el-input>
                    </el-form-item>  -->
                     <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                        <el-input disabled v-model="form.tutorcomment" class="divided_2"></el-input>
                    </el-form-item> 
                    <el-form-item label="学员状态：" :label-width="formLabelWidth">
                        <el-select disabled v-model="form.status" placeholder="选择状态">
                            <el-option v-for="(membersta,s) in fromLabel.memberStatusList" :key="s" :label="membersta.attriname" :value="membersta.attriid"></el-option>
                        </el-select>
                    </el-form-item>   
                </el-form>

                 <!-- 回访记录 -->
                <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                <el-table
                    :data="gotRecord"
                    stripe 
                    size="mini"
                    border resizable
                    style="width: 100%;margin-left:40px;"
                    max-height="656">
                   <el-table-column label="回访时间" :align="align" :width="columWidth">
                        <template slot-scope="scope">{{scope.row.time | transData}}</template>
                    </el-table-column>
                    <el-table-column label="回访内容" :align="align" :width="columWidth2">
                        <template slot-scope="scope">{{scope.row.content}}</template>
                    </el-table-column>
                    <el-table-column label="回访人" :align="align" :width="columWidth">
                        <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                    </el-table-column>
                     <el-table-column label="回访结果" :align="align" :width="columWidth2">
                        <template slot-scope="scope">
                            {{scope.row.lev1}}{{scope.row.lev2?'-':''}}{{scope.row.lev2}}{{scope.row.lev3?'-':''}}{{scope.row.lev3}}
                        </template>
                    </el-table-column>
                </el-table> 


                <div slot="footer" class="dialog-footer">
                    <el-button class="dialog_close" @click="dialogFormVisible2 = false">关闭</el-button>
                </div>
            </el-dialog>
            
        </div>

         <!-- 添加回访记录 -->
        <div>
            <el-dialog title="添加回访记录" :modal=false :close-on-click-modal=false :visible.sync="dialogFormVisible3">
                <el-tag  class='recordStyle' type="info">CC电话回访</el-tag>
                <el-form >
                    <!-- <el-form-item label="回访人：" placeholder="cc回访" label-width="160px">
                        <el-select v-model="revisit ">
                            <el-option label="CC回访" value="1"></el-option>
                        </el-select>
                    </el-form-item> -->
                    <el-form-item label="呼出结果分类：" placeholder="cc回访" label-width="160px">
                        <el-select placeholder="一级菜单" v-model="yiji"  @change='firstMenuChange' class="divided_140"  style="float:left;">
                            <el-option v-for="(menu1,m1) in returnMenu" :key="m1" :label="menu1.attriname" :value="menu1.attriid"></el-option>
                        </el-select>
                        <el-select placeholder="二级菜单" v-model="erji" @change='secondMenuChange' class="divided_140" style="float:left;">
                            <el-option v-for="(menu2,m2) in returnMenu2" :key="m2" :label="menu2.attriname" :value="menu2.attriid"></el-option>
                        </el-select>
                        <el-select placeholder="三级菜单" v-model="sanji" class="divided_140" style="float:left;">
                            <el-option v-for="(menu3,m3) in returnMenu3" :key="m3" :label="menu3.attriname" :value="menu3.attriid"></el-option>
                        </el-select>
                        <el-form-item label="预约时间：" v-if="yiji==172?true:false" label-width="90px" style="float:left;">
                                <el-date-picker
                                    v-model="reserveTime"
                                    type="date"
                                    style='width:140px;'
                                    value-format="yyyy-MM-dd"
                                    placeholder="选择日期">
                                </el-date-picker>
                        </el-form-item>
                    </el-form-item>
                    <el-form-item label="回访结果：" label-width="160px">
                        <el-input v-model="returnResult"></el-input>
                    </el-form-item>
                </el-form>
                <!-- 回访记录 -->
                <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                <el-table
                    v-loading="loading3"
                    element-loading-text="加载中..."
                    :data="gotRecord"
                    stripe 
                    size="mini"
                    border resizable
                    style="width: 100%;position: relative;left: 40px;"
                    max-height="656">
                    <el-table-column label="回访时间" :align="align" :width="columWidth">
                        <template slot-scope="scope">{{scope.row.time | transData}}</template>
                    </el-table-column>
                    <el-table-column label="回访内容" :align="align" :width="columWidth2">
                        <template slot-scope="scope">{{scope.row.content}}</template>
                    </el-table-column>
                    <el-table-column label="回访人" :align="align" :width="columWidth">
                        <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                    </el-table-column>
                    <el-table-column label="回访结果" :align="align" :width="columWidth2">
                        <template slot-scope="scope">
                            {{scope.row.lev1}}{{scope.row.lev2?'-':''}}{{scope.row.lev2}}{{scope.row.lev3?'-':''}}{{scope.row.lev3}}
                        </template>
                    </el-table-column>                 
                </el-table>
                <div slot="footer" class="dialog-footer">
                    <el-button class="dialog_close" @click="dialogFormVisible3 = false">取 消</el-button>
                    <el-button class="dialog_confirm" type="primary" @click="submitRecord">确 定</el-button>
                </div>
            </el-dialog>
        </div>
        <div class="page_block">
            <el-pagination
                background
                @current-change="handleCurrentChange"
                :current-page.sync="currentPage"
                :page-size="15"
                small
                layout="prev, pager, next, jumper"
                :total="totalCount">
            </el-pagination>
        </div>
  </div>
</template>

<script>
    import base from '../api/base.js'
    import md5 from 'js-md5'
    import {formatDate} from '../../static/js/date.js'
    import { regionData } from 'element-china-area-data'
    export default {
        data() {
            return { 
                tableHeight:window.innerHeight-300,
                notChange:true,
                loading2:true,
                loading3:true,
                status:[],
                agents:[],
                ccList:[],
                formInline: {
                    username_kw: '',
                    nickname_kw:'',
                    status:'',
                    agentid: '',
                    waitStatus:-1,
                    ccId:'',
                    startTime:'',
                    endTime:'',
                },
                ifchild:'',
                userid:'',//选中的学员
                userInfo:[],
                columWidth:150,
                columWidth2:240,
                align:'center',
                studentsData: [],
                returnMenu:[],//回访菜单1
                returnMenu2:[],//回访菜单2
                returnMenu3:[],//回访菜单3
                firstMenu:[],//一级菜单id
                secondMenu:[],//二级菜单id
                // =============================================添加回访表单
                yiji:'',
                erji:'',
                sanji:'',
                revisit:1,//回访人
                returnResult:'',//回访结果
                reserveTime:'',
                dialogFormVisible:false,
                dialogFormVisible2:false,//档案
                dialogFormVisible3:false,//添加回访记录
                formLabelWidth: '200px',
                // 分页数据
                currentPage: 1,
                totalCount:0,
                cur_page:1,
                pageSize:14,
                fromLabel:[],
                childData:[],
                form: {
                     //  =======================================成人表单数据
                    nickname:'',
                    new_pwd:'',
                    fullname:'',
                    mobile:'',
                    email:'',
                    gender:'',
                    face:'',
                    daxue:'',
                    zhuanye:'',
                    gongsi:'',
                    job:'',
                    zhiwei:'',
                    gongsiwangzhi:'',
                    gongsidianhua:'',
                    lianxiren:'',
                    qq:'',
                    skypenum:'',
                    isfirststudy:'',
                    age:'',
                    studylevel:'',
                    highscore:'',
                    province:'',
                    cityname:'',
                    district:'',
                    wanttostudy:[],
                    studyhigh:[],
                    studyextension:[],
                    // studyfrom:[],
                    studyshijian: '',
                    StudentEvaluationGrade:'',
                    level: '',
                    targetlevel:'',
                    iwant: '',
                    groupid:'',
                    firstpay:'',
                    tutorcomment: '',
                    status:'',
                    //  =======================================少儿
                    username:'',
                    regdate:'',
                    lastdate:'',
                    loginnum:'',
                    new_pwd:'',
                    // nickname: '',
                    mobile:'',
                    fullname: '',
                    sendmail:'',
                    // qq: '',
                    // skypenum:'',
                    email: '',
                    gender:'',
                    birthday: '',
                    toycartoon:'',
                    shoolPeriod: '',//学年
                    xuenianid:'',
                    grade:'',//年级
                    character:'',
                    avatar:'',
                    // province: '',//省
                    // cityname:'',//市
                    // district: '',//区
                    giftAddr:'',
                    studyfrom:[],//学习渠道
                    dadname:'',//父亲
                    dadmobile:'',
                    dadage:'',
                    dadjob:'',
                    mumname:'',//母亲
                    mummobile:'',
                    mumage: '',
                    mumjob:'',
                    familyincome: '',//家庭收入
                    alreadystudy:'',
                    studytime:'',
                    stratway:'',
                    withforeign:'',//是否接触其他外教课程
                    foreigntime:'',
                    schoolname:'',
                    englishrank:'',
                    englishlevel:'',
                    expects:[], 
                    improvefields:[],
                    considerfield:'',//考虑方面
                    weekTime:'',
                    suitabletime:[],
                    monthbudget:'',
                    finishtime:'',
                    budget:'',
                    appeal:'',
                    teachernote:'',
                    state:'',
                    delivery: false, 
                    address:[]
                },
                // 省市区
                options: regionData,
                // 头像
                upLoadData: {
                    bucket: 'avatar'
                },
                avatar_url:base.baseUrl+'/forum/upload/index',
                // 获取的年级列表
                grade_lists:'',
                address:[],
                //回访记录
                gotRecord:[],
                writeRecord:[
                    {
                        result:'',
                        content:'',
                        writer:'',
                        time:''
                    }
                ],//添加
                returnForm:[],//回访表单,
                xxSelect:false
            }
        },
        methods: {
            handleCurrentChange(val) {
                this.loading2=true
                this.cur_page=val;
                this.getData();
            },
            // 编辑资料
            handleEdit(uid,ischild){
                this.userid=uid;
                this.dialogFormVisible=true;
                if(ischild==1){
                   this.ifchild=true;
                   this.getUserInfo()
                }else{
                    this.ifchild=false
                    this.getUserInfo()
                } 
                this.getAdultform()
                this.getChildform()              
                
            },
            getData(cr){ 
                if(cr){
                    this.cur_page=this.currentPage=1
                }
                this.$axios({
                    url: base.baseUrl+"/school/member/get-member-rebate-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        p:this.cur_page,
                        nickname_kw:this.formInline.nickname_kw,
                        username_kw:this.formInline.username_kw,
                        status:this.formInline.status,
                        // agentid:this.formInline.agentid,
                        waitStatus:this.formInline.waitStatus,
                        ccId:this.formInline.ccId,
                        startTime:this.formInline.startTime,
                        endTime:this.formInline.endTime,
                        pageSize:this.pageSize
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.studentsData=res.data.data.data;
                        this.loading2=false
                        this.totalCount=Number(res.data.data.pages.totalCount);
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            clearSearch(){
                this.formInline.agentid=''
                this.formInline.status=''
                this.formInline.username_kw=''
                this.formInline.nickname_kw=''
                this.formInline.waitStatus=this.formInline.ccId=this.formInline.startTime=this.formInline.endTime=''
                this.getData(true)
            },
            // 申请代转化
            applyTransfer(uid){
                this.userid=uid
                this.$confirm('你确认将学员交由云海螺代为转化吗？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.changeMemStatus()
                }).catch(() => {
                          
                });
               
            },
            changeMemStatus(){
                 this.$axios({
                    url: base.baseUrl+"/school/member/change-member-conversion-status",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userId:this.userid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    this.alertTip(res.data.msg)
                    if(res.data.code==200){
                        this.getData()
                    }
                });
            },
            // 获取学员信息
            getUserInfo(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-info",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // this.userInfo=res.data.data;   
                    // this.form.address.push(this.userInfo.memberdetail.giftprovince,this.userInfo.memberdetail.giftcity,this.userInfo.memberdetail.giftdistrict);   
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.userInfo=res.data.data;
                        // 成人
                        this.form.nickname=this.userInfo.nickname;
                        this.form.fullname=this.userInfo.fullname;
                        this.form.mobile=this.userInfo.mobile;
                        this.form.email=this.userInfo.email;
                        this.form.gender=this.userInfo.memberdetail.gender;
                        this.form.province=this.userInfo.memberdetail.giftprovince;
                        this.form.cityname=this.userInfo.memberdetail.giftcity;
                        this.form.district=this.userInfo.memberdetail.giftdistrict;
                        this.form.address.push(this.userInfo.memberdetail.giftprovince,this.userInfo.memberdetail.giftcity,this.userInfo.memberdetail.giftdistrict);
                        this.form.daxue=this.userInfo.memberdetail.daxue;
                        this.form.gongsi=this.userInfo.memberdetail.gongsi;
                        this.form.job=this.userInfo.memberdetail.job;
                        this.form.zhiwei=this.userInfo.memberdetail.zhiwei;
                        this.form.qq=this.userInfo.memberdetail.qq;
                        this.form.skypenum=this.userInfo.memberdetail.skypenum;
                        this.form.isfirststudy=this.userInfo.memberdetail.isfirststudy;
                        this.form.age=this.userInfo.memberdetail.age;
                        this.form.studyfrom=this.userInfo.memberdetail.studyfrom;
                        this.form.studylevel=this.userInfo.memberdetail.studylevel;
                        this.form.wanttostudy=this.userInfo.memberdetail.wanttostudy;
                        this.form.highscore=this.userInfo.memberdetail.highscore;
                        this.form.studyextension=this.userInfo.memberdetail.studyextension;
                        this.form.studyhigh=this.userInfo.memberdetail.studyhigh;
                        this.form.studyshijian=this.userInfo.memberdetail.studyshijian;        
                        this.form.groupid=this.userInfo.groupid;
                        this.form.targetlevel=this.userInfo.memberdetail.targetlevel;
                        this.form.iwant=this.userInfo.memberdetail.iwant;              
                        this.form.level=this.userInfo.memberdetail.level;
                        this.form.firstpay=this.userInfo.memberdetail.firstpay;
                        this.form.tutorcomment=this.userInfo.memberdetail.tutorcomment;
                        this.form.status=this.userInfo.status;
                        this.form.budget=this.userInfo.memberdetail.budget;

                        //少儿
                        this.form.username=this.userInfo.username;
                        this.form.regdate=this.userInfo.regdate;
                        this.form.lastdate=this.userInfo.lastdate;
                        this.form.loginnum=this.userInfo.loginnum;
                        this.form.sendmail=this.userInfo.sendemail;
                        // this.form.birthday=this.userInfo.memberdetail.birthday;
                        this.form.toycartoon=this.userInfo.memberchild.toycartoon;
                        this.form.grade=this.userInfo.memberchild.grade;
                        this.form.birthday=this.userInfo.memberchild.birthyear+'-'+this.userInfo.memberchild.birthmonth+'-'+this.userInfo.memberchild.birthdate;
                        this.form.character=this.userInfo.memberchild.character;
                        // this.form.address=this.userInfo.memberdetail.giftprovince+'-'+this.userInfo.memberdetail.giftcity+'-'+this.userInfo.memberdetail.giftdistrict;
                        this.form.dadname=this.userInfo.memberchild.dadname;
                        this.form.dadage=this.userInfo.memberchild.dadage;
                        this.form.dadjobs=this.userInfo.memberchild.dadjob;
                        this.form.dadmobile=this.userInfo.memberchild.dadmobile;
                        this.form.mumname=this.userInfo.memberchild.mumname;
                        this.form.mummobile=this.userInfo.memberchild.mummobile;
                        this.form.mumage=this.userInfo.memberchild.mumage;
                        this.form.mumjob=this.userInfo.memberchild.mumjob;
                        this.form.familyincome=this.userInfo.memberchild.familyincome;
                        this.form.alreadystudy=this.userInfo.memberdetail.isfirststudy;
                        this.form.stratway=this.userInfo.memberchild.stratway;
                        this.form.withforeign=this.userInfo.memberchild.withforeign;
                        this.form.studytime=this.userInfo.memberchild.learnedtime;
                        this.form.foreigntime=this.userInfo.memberchild.foreigntime;
                        this.form.schoolname=this.userInfo.memberchild.schoolname;
                        this.form.englishrank=this.userInfo.memberchild.englishrank;
                        this.form.englishlevel=this.userInfo.memberchild.englishlevel;
                        this.form.expects=this.userInfo.memberchild.expect;
                        this.form.improvefields=this.userInfo.memberchild.improvefields;
                        this.form.considerfield=this.userInfo.memberchild.considerfield;
                        this.form.weekTime=this.userInfo.memberchild.weektime;
                        this.form.suitabletime=this.userInfo.memberchild.suitabletime;
                        this.form.monthbudget=this.userInfo.memberchild.monthbudget;
                        this.form.teachernote=this.userInfo.memberdetail.tutorcomment;
                        this.form.finishtime=this.userInfo.memberdetail.studyshijian;
                        this.form.budget=this.userInfo.memberdetail.studymoney;
                        this.form.englishlevel=this.userInfo.memberdetail.studylevel;
                        this.form.appeal=this.userInfo.memberdetail.iwant;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            // ==========================================成人
            getAdultform(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-setting ",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.fromLabel=res.data.data;
                    }
                });
            },
            editAdult(){
                this.$axios({
                    url: base.baseUrl+"/school/member/set-adult-student",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid,
                        nickname: this.form.nickname,
                        new_pwd:this.form.new_pwd?md5(this.form.new_pwd):'',
                        fullname:this.form.fullname,
                        mobile:this.form.mobile,
                        email:this.form.email,
                        gender:this.form.gender,
                        face:this.form.face,
                        province:this.form.province,
                        cityname:this.form.cityname,
                        district:this.form.district,
                        address:this.form.address,
                        daxue:this.form.daxue,
                        zhuanye:this.form.zhuanye,
                        gongsi:this.form.gongsi,
                        job:this.form.job,
                        zhiwei:this.form.zhiwei,
                        gongsiwangzhi:this.form.gongsiwangzhi,
                        gongsidianhua:this.form.gongsidianhua,
                        lianxiren:this.form.lianxiren,
                        qq:this.form.qq,
                        skypenum:this.form.skypenum,
                        isfirststudy:this.form.isfirststudy,
                        age:this.form.age,
                        studyfrom:this.form.studyfrom,
                        studylevel: this.form.studylevel,
                        highscore:this.form.highscore,
                        wanttostudy: this.form.wanttostudy,
                        studyhigh:this.form.studyhigh,
                        studyextension:this.form.studyextension,
                        studyshijian:this.form.studyshijian,
                        studymoney:this.form.studymoney,
                        level:this.form.level,
                        targetlevel: this.form.targetlevel,
                        iwant:this.form.iwant,
                        groupid: this.form.groupid,
                        tutorcomment:this.form.tutorcomment,
                        status:this.form.status
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                       this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.alertTip('编辑成功')
                        this.dialogFormVisible = false;
                    }
                });
            },
             // ==========================================儿童
            editChild(){
                this.$axios({
                    url: base.baseUrl+"/school/member/set-child-student",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid,
                        new_pwd:this.form.new_pwd?md5(this.form.new_pwd):'',
                        nickname: this.form.nickname,
                        mobile:this.form.mobile,
                        fullname:this.form.fullname,
                        sendmail:this.form.sendmail,
                        qq:this.form.qq,
                        skypenum:this.form.skypenum,
                        email:this.form.email,
                        gender:this.form.gender,
                        birthday:this.form.birthday,
                        toycartoon:this.form.toycartoon,
                        schoolPeriod:this.form.shoolPeriod,
                        grade:this.form.grade,
                        character:this.form.character,
                        avatar:this.form.avatar,
                        province:this.form.province,
                        cityname:this.form.cityname,
                        district:this.form.district,
                        giftAddr:this.form.giftAddr,
                        studyFrom:this.form.studyfrom,
                        dadname:this.form.dadname,
                        dadmobile:this.form.mobile,
                        dadage:this.form.dadage,
                        dadjob:this.form.dadjob,
                        mumname:this.form.mumname,
                        mummobile:this.form.mummobile,
                        mumage:this.form.mumage,
                        mumjob:this.form.mumjob,
                        familyincome:this.form.familyincome,
                        alreadystudy:this.form.alreadystudy,
                        studytime:this.form.studytime,
                        stratway:this.form.stratway,
                        withforeign:this.form.withforeign,
                        foreigntime:this.form.foreigntime,
                        schoolname:this.form.schoolname,
                        englishrank:this.form.englishrank,
                        englishlevel:this.form.englishlevel,
                        expects:this.form.expects,
                        improvefields:this.form.improvefields,
                        considerfield:this.form.considerfield,
                        weekTime:this.form.weekTime,
                        suitabletime:this.form.suitabletime,
                        monthbudget:this.form.monthbudget,
                        finishtime:this.form.finishtime,
                        budget:this.form.budget,
                        appeal:this.form.appeal,
                        teachernote:this.form.teachernote,
                        state:this.form.status   
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.alertTip('编辑成功')
                        this.dialogFormVisible = false;
                    }
                });
            },
            // 选择地区
            handleChange (value) {
                this.form.province=value[0];//省id
                this.form.cityname=value[1];//市id
                this.form.district=value[2];//区id
            },
            uploadAvatar(response){
                if(response.code==200){
                    this.form.upavatar_url=response.data;
                }
            },
            // 选择学年
            getPeriod:function(e){
                this.form.xuenianid=e;
                this.getGrade();
            },
            // 儿童表单
            getChildform(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-setting ",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        user_role:'child'
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.childData=res.data.data;
                    }
                });
            },
            // 获取年级
            getGrade(){
                this.$axios({
                    url: base.baseUrl+"/school/setting/get-class",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        attid: this.form.xuenianid,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.grade_lists=res.data.data;
                    };
                }); 
            },
            //============================================================================================================================
            // 获取回访记录
            getFile(uid,ischild){
                this.dialogFormVisible2=true;
                this.userid=uid;
                if(ischild==1){
                   this.ifchild=true;
                   this.getUserInfo()
                   this.getRecord()
                }else{
                    this.ifchild=false
                    this.getUserInfo()
                    this.getRecord()
                }
                this.getAdultform()
                this.getChildform()
            },
            // 获取回访记录
            getRecord(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-visit",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid
                        // userid:151166
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                   if(res.data.code==200){
                       this.gotRecord=res.data.data
                       this.loading3=false
                   }
                });
            },
            //获取回访菜单(1级)
            getReturnMenu(){
                this.$axios({
                    url: base.baseUrl+"/school/setting/get-visit-menu",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                }).then(res => {
                   if(res.data.code==200){
                       this.returnMenu=res.data.data
                   }
                });
            },
            firstMenuChange:function(e){
                this.firstMenu=e;
                this.getSecondMenu()
            },
            secondMenuChange(e){
                this.secondMenu=e;
                this.getThirdMenu()
            },
            getSecondMenu(){
                this.$axios({
                    url: base.baseUrl+"/school/setting/get-visit-menu",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        menuid:this.firstMenu
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                   if(res.data.code==200){
                       this.returnMenu2=res.data.data
                   }
                });
            },
            getThirdMenu(){
                this.$axios({
                    url: base.baseUrl+"/school/setting/get-visit-menu",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        menuid:this.secondMenu
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.returnMenu3=res.data.data
                    }
                });
            },
            //添加回访记录
            addRecord(uid){
                this.dialogFormVisible3=true;
                this.getReturnMenu()
                this.userid=uid
                this.getRecord()
            },
            submitRecord(){
                this.$axios({
                    url: base.baseUrl+"/school/member/add-visit",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        userid:this.userid,
                        type_a:this.revisit,
                        lev1:this.yiji,
                        lev2:this.erji,
                        lev3:this.sanji,
                        type_d:this.reserveTime,
                        content:this.returnResult
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.$alert('添加成功', '提示', {
                            confirmButtonText: '确定',
                            callback: action => {
                                this.yiji=this.erji=this.sanji=this.reserveTime=this.returnResult=''
                            }
                        });
                        this.getRecord()
                    }
                });
            },
            alertTip(msg){
                this.$alert(msg, '提示', {
                    confirmButtonText: '确定',
                    callback: action => {
                        this.$message({
                            type: 'info',
                        });
                    }
                });
            },
            getStatus(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-member-status-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.status=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login');
                    }
                });
            },
            getAgents(){
                this.$axios({
                    url: base.baseUrl+"/school/agent/get-agent-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.agents=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login');
                    }
                });
            },
            getCCList(){
                this.$axios({
                    url: base.baseUrl+"/school/setting/get-admin-cc-select",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.ccList=res.data.data
                    }else if(res.data.code==-2){
                        this.$router.push('/login');
                    }
                });
            },
            ifShowxianxia(){
                if(localStorage.roleid==10||localStorage.roleid==12||localStorage.roleid==13||localStorage.roleid==14||localStorage.roleid==15){
                    this.xxSelect=true
                }
            }
        },
        filters:{
            transData(time){
                return formatDate(new Date(time * 1000), 'yyyy-MM-dd hh:mm');
            }
        },
        created(){
            this.getData()
            this.getStatus();
            this.getAgents()
            this.getCCList()
            this.ifShowxianxia()

        }  
  }

</script>
<style lang="less" scoped>
@media screen and (max-width:1700px){
    .el-form--inline{
        // background: #ff5263;
        width: 1400px;
    }  
}
@media screen and (max-width:1280px){
    .inputReset{
        width: 120px;
    }
    .el-form--inline{
        // background: #ff5263;
        width: 1000px;
    }
}
.el-form-item{
    margin-bottom: 16px;
}
.operate_inputs{
    padding: 15px 0 0 15px;
    // height: 70px;
    box-sizing: border-box;
    button{
        width: 130px;
        height: 38px;
        border-radius: 4px;
        border: none;
    }
    .search_btn{       
        background-color: #ff5263;
    }
    .reset_btn{
        background-color: #808080;
    }
}
.page_block{
    position: absolute;
    margin-top:12px;
    right: 5%;
}
.recordStyle{
    width: 100%;
    text-align: center;
    margin: 10px 0 30px 40px;
}
</style>


